home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / UTILREEN / BITFNT38.LZH / HPLAJET2.BFC < prev    next >
Text File  |  1987-05-03  |  7KB  |  257 lines

  1. n,"HP LaserJet II";
  2.   x: df=1;      {init data format to 1}
  3.   x: xd=1;      {single horizontal density}
  4.   x: yd=1;      {single vertical density}
  5.   x: to=40;
  6.   x: lo=0;
  7.   x: cw=30;
  8.   x: ch=50;
  9.   x: ep=124,"Delta-X (quarter dots)";
  10.  
  11.   a: aa=1;      {allow adjacent dots}
  12.   a: fw=30;
  13.   a: fh=50;
  14.   a: bl=40;
  15. a: d8=0;   {d8=1 says downloading}
  16. e; {end initialization section.}
  17. a: zt=0; {will get no font trailer message if no loading entire font}
  18. KI; {start input font header.}
  19. a: zt=1; {used to suppress no font trailer message}
  20. #:**, "Loading Font Header ";
  21.   L 2;
  22.   u: za;
  23.   j 2: za,ne,$1b; {look for esc}
  24.   u: zb;
  25.   j 2: zb,ne,$29; {look for ) }
  26.   u: zc;
  27.   j 2: zc,ne,$73;  {look for s }
  28.   d: zl;      {escape sequence main data length}
  29.   u: zz;      {throw away term char}
  30.   w: fd,"Font Descriptor size";      {font descriptor size}
  31.   u: yz;      {reserved}
  32.   u: ft,"Font type";
  33.   w: yz;      {reserved}
  34.   w: bl; {Baseline Distance (dots)}
  35.   w: fw; {Cell Width (dots)}
  36.   w: fh; {Cell Height (dots)}
  37.   u: oo; {font overall orientation}
  38.   u: ks,"Spacing (0=fixed,1=prop)";
  39.   w: ss,"Symbol Set";
  40.   w: pt,"Pitch (quarter dots)";
  41.   w: jh,"Height (quarter dots)";
  42.   w: xh,"xHeight (quarter dots)";
  43.   s: wt,"Width Type";
  44.   u: st,"Style";
  45.   s: sw,"Stroke Weight";
  46.   u: tf,"Typeface";
  47. j 4: fd,eq,40;
  48.   u: zz;      {reserved}
  49.   u: sf,"Serif Style";
  50.   w: zz;      {reserved}
  51.   s: ud,"Underline Distance (dots)";
  52.   u: uh,"Underline Height (dots)";
  53.   w: th,"Text Height (quarter dots)";
  54.   w: tw,"Text Width (quarter dots)";
  55.   w: zz;      {reserved}
  56.   w: zz;      {reserved}
  57.   u: pe,"Pitch Extended (1024ths dot)";
  58.   u: he,"Height Extended (1024ths dot)";
  59.   w: zz;      {reserved}
  60.   w: zz;      {reserved}
  61.   w: zz;      {reserved}
  62.   q: fn,,16,"Font Name";
  63.   j 5: 1,eq,1;
  64.   L 4;
  65.   q: fn,,14,"Font Name";
  66.   L 5;
  67.   a: el=fp;
  68.   q: cy,,,"Copyright Notice"; {allowed to terminate by next escape}
  69.   a: el=fp-el;  {length of copyright notice}
  70. EI; {end input font header.}
  71.   L 8;
  72. j 12:fp,ge,fs;
  73.   u: zz;
  74.   j 8: zz,ne,$1b; {look for esc}
  75.   u: zz;
  76.   j 8: zz,ne,$2a; {look for * }
  77.   u: zz;
  78.   j 8: zz,ne,$63;  {look for c }
  79.   d: cc;      {decimal code of character}
  80.   u: zz;      {throw away term char}
  81. L1; {label 1 to indicate start of character.}
  82. $ : cc,"Loading code (hex) ";
  83.   L 11;
  84.   u: zz;
  85.   j 11: zz,ne,$1b; {look for esc}
  86.   u: zz;
  87.   j 11: zz,ne,$28; {look for ( }
  88.   u: zz;
  89.   j 11: zz,ne,$73;  {look for c }
  90.   d: zl;      {length of character descriptor and data}
  91.   u: zz;      {throw away term char}
  92.   u: zf;      {format of descriptor}
  93.   u: zx;      {continuation}
  94.   u: zs;      {descriptor size}
  95. z 19:zs-1;
  96.   u: zz;      {class ( data format)}
  97.   u: or;  {Character Orientation}
  98.   u: zz;  {reserved}
  99.   i: lo;  {left offset}
  100.   i: to;  {top offset}
  101.   w: cw;  {character width}
  102.   w: ch;  {character height}
  103.   i: ep;  {endpoint}
  104. L 19; R;
  105.   a: xl=zl-zs-2; {actual datalength}
  106. j 31: zx,ne,0;
  107.   g:0,xl; {character data}
  108.   a: xc=xl;
  109. L 31;
  110. j 32: zx,ne,1;
  111.   g:xc,xl; {character data}
  112.   a: xc=0;
  113. L 32;
  114. ESL; {end character search, character loaded.}
  115.   j 8:1,eq,1; {go get next char}
  116. L 12;
  117. #:**,"Font loaded.";
  118. KT; {start input font trailer.}
  119. j 40: zt,eq,1;  {suppress no font trailer message if loading entire font}
  120. #R:**,"HP LaserJet II fonts do not have a trailer.  Hit return.";
  121. L 40;
  122. a: zt=0; {will get no font trailer message if not loading entire font}
  123. ET; {end font trailer.}
  124. KS; {start search for an input character.}
  125.   z 10:fs-fp;
  126.   L 9;
  127.   u: zz;
  128.   j 9: zz,ne,$1b; {look for esc}
  129.   u: zz;
  130.   j 9: zz,ne,$2a; {look for * }
  131.   u: zz;
  132.   j 9: zz,ne,$63;  {look for c }
  133.   d: zc;      {decimal code of character}
  134. $: zc,"Encountered code (hex): ";
  135. #: fp,"At file position: ";
  136.   u: zz;      {throw away term char}
  137. j 14: zc,eq,cc;
  138.   L 13;
  139.   u: zz;
  140.   j 13: zz,ne,$1b; {look for esc}
  141.   u: zz;
  142.   j 13: zz,ne,$28; {look for ( }
  143.   u: zz;
  144.   j 13: zz,ne,$73;  {look for c }
  145.   d: zl;      {length of character descriptor and data}
  146.   u: zz;      {throw away term char}
  147.   p: fp + zl - 1; {position file past this character}
  148.   j 9: zc,ne,cc;  {looking for current code}
  149. L 14;
  150. # : cc,"Found code (dec)";
  151.   j 1: 1,eq,1;   {found, go get it}
  152.   L 10;       {char not found}
  153. ESU; {end character search program (unsuccessful search)}
  154. KO; {start output font header.}
  155. L 88; {for download}
  156. #:**, "Sending Font Header ";
  157.   u:$1b;
  158.   u:$29;
  159.   u:$73;
  160.   d:fd+cy;      {escape sequence main data length}
  161.   y:"W";      {term char}
  162.   w: fd;      {font descriptor size}
  163.   u:$00;      {reserved}
  164.   u: ft;       {font type}
  165.   w:$00;      {reserved}
  166.   w: bl;     {Baseline Distance (dots)}
  167.   w: fw; {Cell Width (dots)}
  168.   w: fh; {Cell Height (dots)}
  169.   u: ko; {Orientation (0=portrt,1=landscp)}
  170.   u: ks; {Spacing (0=fixed,1=prop)}
  171.   w: ss; {Symbol Set}
  172.   w: pt; {Pitch (quarter dots)}
  173.   w: jh; {Height (quarter dots)}
  174.   w: xh; {xHeight (quarter dots)}
  175.   s: wt; {Width Type}
  176.   u: st; {Style}
  177.   s: sw; {Stroke Weight}
  178.   u: tf; {Typeface}
  179. j 44: fd,eq,40;
  180.   u:$00;      {reserved}
  181.   u: sf; {Serif Style}
  182.   w:$00;      {reserved}
  183.   s: ud; {Underline Distance (dots)}
  184.   u: uh; {Underline Height (dots)}
  185.   w: th; {Text Height (quarter dots)}
  186.   w: tw; {Text Width (quarter dots)}
  187.   w:$00;      {reserved}
  188.   w:$00;      {reserved}
  189.   u: pe;  {Pitch Extended (1024ths dot)}
  190.   u: he;  {Height Extended (1024ths dot)}
  191.   w:$00;      {reserved}
  192.   w:$00;      {reserved}
  193.   w:$00;      {reserved}
  194.   q: fn,,16; {Font Name}
  195.   j 45: 1,eq,1;
  196.   L 44;
  197.   q: fn,,14; {Font Name}
  198.   L 45;
  199.   q: cy,,el; {Copyright Notice}
  200. EO; {end output font header.}
  201. a:cc=0;  {start with first possible code, zero}
  202. c;       {select first valid code}
  203. j 57:1,eq,1; {bypass first code check}
  204. L 55;
  205.   c;  {select first valid code}
  206. j 59:cc,eq,0;  {go to 59 if no more valid codes}
  207. L 57;
  208. KC; {start output character}
  209. $ :cc,"Sending code (hex): ";
  210.   u:$1b;
  211.   u:$2a;
  212.   u:$63;
  213.   d: cc;      {decimal code of character}
  214.   u:$45;      {term char}
  215.   u:$1b;
  216.   u:$28;
  217.   u:$73;
  218.   d: dl+16;      {length of character descriptor and data}
  219.   y:"W";      {term char}
  220.   u:4;      {format of descriptor}
  221.   u:0;      {continuation}
  222.   u:14;       {descriptor size}
  223.   u:1;        {class ( data format)}
  224.   u: co;     {Character Orientation}
  225.   u:0;  {reserved}
  226.   i: lo;  {left offset}
  227.   i: to;  {top offset}
  228.   w: cw;  {character width}
  229.   w: ch;  {character height}
  230.   i: ep;  {endpoint}
  231.   g;   {character data}
  232. EC; {end output character.}
  233. a:cc=cc+1;
  234. j 55:1,eq,1;
  235. L 59;   {end}
  236. KZ; {start output font trailer.}
  237. j 89:d8,eq,1; {go finish download if downloading}
  238. ET; {end font trailer.}
  239. KP; {start download}
  240.   a:d8=1;  {downloading indicator}
  241. #a:id," Enter a font ID number (0 to 32767): ";
  242.   u:$1b;
  243.   u:$2a;
  244.   u:$63;
  245.   d:id;
  246.   u:$44;
  247. j 88: 1,eq,1; {go save font to the printer}
  248. L 89; {now make it primary}
  249.   a:d8=0; {turn off download indicator}
  250.   u:$1b;
  251.   u:$28;
  252. #:id," Font loaded with ID: ";
  253.   d:id;
  254.   u:$58;
  255. EP; {end download}
  256. .
  257.